<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
      template="template.xhtml">
        
    <ui:define name="Cheader">
        <h:form id="formHeader">
            <p:panelGrid rendered="#{cPri.esUsuario}" style="font-size:small;max-width: 98%" columns="2">
                <p:outputLabel value="Hola #{user.usuUsuario}!"/>
                <h:commandButton rendered="#{cPri.esUsuario}" id="logout" 
                        value="Logout" 
                        action="#{usermanager.logout}"/>
            </p:panelGrid>
            <p:panelGrid rendered="#{!cPri.esUsuario}" style="font-size:small;max-width: 98%" columns="1">
                <h:commandButton 
                        value="Crear cuenta" 
                        action="#{cPri.CambioCentroReturn('usuarios/create')}" 
                        
                        />
            </p:panelGrid>
        </h:form>
    </ui:define>
    <ui:define name="Cfooter">
        define footer
    </ui:define>
    <ui:define name="Cmenu">
          <h:form id="formMenu">
            <p:growl id="messages"/>  
            <p:menu style="font-size: small;width: 98%">  
                <p:submenu label="MENU" icon="ui-icon-heart">  
                    <p:menuitem value="Inicio" actionListener="#{cPri.CambioCentro('index')}" icon="ui-icon-wrench" update=":Ccontent" />   
                    <p:menuitem value="Negocios" actionListener="#{cPri.CambioCentro('negocios/listanegocios')}" icon="ui-icon-wrench" update=":Ccontent" />   
                </p:submenu>  
            </p:menu> 
          </h:form>
    </ui:define>
    <ui:define name="Ccentral">
        <h:panelGroup id="Ccontent" layout="block">
                <p:ajaxStatus style="width:64px;height:64px;position:fixed;right:5px;bottom:5px" id="ajaxStatusPanel">  
                    <f:facet name="start">  
                        <h:graphicImage style="width:64px;height:64px;" value="/img/loading.gif" /> 
                    </f:facet>  

                    <f:facet name="complete">  
                        <h:outputText value="" />  
                    </f:facet>  
                </p:ajaxStatus>  
            <h:form id="formCentro">
                <ui:include src="#{cPri.pagCentro}.xhtml" />
            </h:form>
        </h:panelGroup>
    </ui:define>
</ui:composition>

